'''
@Author       : 冯浩
@Date         : 2019-12-04 22:58:49
@LastEditors  : 冯浩
@LastEditTime : 2019-12-19 21:10:01
@FilePath     : \bob_develop\python\闭包和装饰器.py
'''

def deco(str_):
    def func0(func):
        print('func0', str_)  # 装饰器传参

        def func1(num):
            print('func1', num)  # 函数传参
            return func(num)
            
        return func1

    return func0


@deco('装饰器传参')  # 若无装饰器传参,则可以去掉func0层,并将func移至最外层
def say_hello(num):
    print('hello', num)


say_hello('函数传参')

'''
func0 装饰器传参
func1 函数传参
hello 函数传参
'''
